Crate win_variant
source · [−]Expand description
win-variant
win-variant is a crate to improve the ergonomics of working with VARIANTS from winapi.
The crate uses enums and conversion traits to allow for modern rust usage as well as provides utilities to easily free VARIANTS correctly.
Structs
SafeArray
provides an ergnomic structure that allows for converting
SAFEARRAY
data structures from a VARIANT
into Vec
or ArrayD
. The
structure also destroys the SAFEARRAY
when the SafeArray
instance is
dropped.
Enums
VariantArg is a type to simplify the conversion of rust types into variants that are used by windows APIs. Make sure to use the free_variant(s) functions if you convert the VariantArg to VARIANT.
VariantResult is a tyoe that can be converted from VARIANT to automatically convert the VARIANT value to a rust type that is easier to work with. The VARIANT can be dropped after the conversion as the data is copied into the VariantResult.
Functions
Safety
free_variants is a utility to properly free the allocated resources of variants.